﻿using Dto;
using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY19.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class EmployeeController : ControllerBase
    {
        public EmployeeController(IEmployeeBLL bll)
        {
            Bll = bll;
        }

        public IEmployeeBLL Bll { get; }
        [HttpPost]
        public Task<int> AddEmployee(EmployeeModel employee)
        {
            return Bll.AddEmployee(employee);
        }
        [HttpGet]
        public Task<int> DeleteRangeEmployee(string idstring)
        {
           return Bll.DeleteRangeEmployee(idstring);


        }
        [HttpGet]
        public EmployeeShowDto EmployeeShow(string? name, int typeid, int pageindex, int pagesize)
        {
            return Bll.EmployeeShow(name, typeid, pageindex, pagesize);
        }
        [HttpGet]
        public EmployeeModel Fan(int id)
        {
            return Bll.Fan(id);
        }
        [HttpPost]
        public Task<int> UpdateEmployee(EmployeeModel employee)
        {
            return Bll.UpdateEmployee(employee);
        }
        [HttpGet]
        public Task<int> UpdateRangeUpdate(string idstring)
        {
            return Bll.UpdateRangeUpdate(idstring);
        }
    }
}
